home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18217 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  49 lines

  1. Newsgroups: comp.lang.smalltalk,comp.lang.java,comp.lang.c++
  2. Path: netcom.com!gscott
  3. From: gscott@netcom.com (Gavin Scott)
  4. Subject: Re: Smalltalk slower than C++
  5. Message-ID: <gscottDq3Ipq.1rz@netcom.com>
  6. Followup-To: comp.lang.smalltalk,comp.lang.java,comp.lang.c++
  7. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  8. X-Newsreader: TIN [version 1.2 PL1]
  9. References: <4kuavb$1dbc@watnews1.watson.ibm.com> <3174DD97.6BE1D26@bnr.ca> <3177048B.2CBD@alumni.caltech.edu>
  10. Date: Fri, 19 Apr 1996 06:15:26 GMT
  11. Sender: gscott@netcom.netcom.com
  12.  
  13. Mike Klein (mklein@alumni.caltech.edu) wrote:
  14. : Here's a simple sample task:
  15. :     Open a scrolling list interface on integers from one to ten million.
  16.  
  17. : Smalltalk results:
  18.  
  19. :     Coding time: 20 sec. (Yes I actually timed it).
  20. :     Execution time: 64 millisecons (Sun Ultra-1, VW2.5)
  21. :     Source code:
  22.  
  23. :     SequenceView openOn: (1 to: 10000000).
  24.  
  25. : I look forward to hearing *any* results from the Java/C++ world.
  26.  
  27. Ok, I'll bite :-)
  28.  
  29. Looks like you didn't save the SequenceView instance you created, so 
  30. after the user selects the number he wants (say by clicking on the
  31. up scrollbar arrow an average of five million times) you won't be 
  32. able to do anything with the data since you can't get to it.
  33.  
  34. And I *hate* scrolling lists used for numeric input, so we'll just use
  35. a nice simple labeled numeric input box and do it in Java:
  36.  
  37. NumericInputBox myInput = new NumericInputBox("Enter Number:", 1,  10000000);
  38. add(myInput);
  39.  
  40. So there. Nyeah. Of course the implementation of NumericInputBox  is
  41. left as an exercise, but it's pretty trivial to do.  Watch Java have
  42. a more complete class library in six months than Smalltalk has got
  43. after 20 years.
  44.  
  45. G.
  46.  
  47. P.S. Smalltalk is still perhaps my favorite language, but Java has a
  48. lot of things going for it that ST does not.
  49.